const { authenticate } = require('feathers-authentication').hooks
const commonHooks = require('feathers-hooks-common')
const local = require('feathers-authentication-local')
// const { restrictToOwner } = require('feathers-authentication-hooks')
// const { hashPassword } = require('feathers-authentication-local').hooks

export = {
  before: {
    all: [],
    find: [],
    get: [],
    create: [
      local.hooks.hashPassword(),
    ],
    update: [],
    patch: [],
    remove: []
  },

  after: {
    all: [],
    find: [
      (hook: any) => {
        return hook
      }
      // commonHooks.when(
      //   (hook: any) => hook.params.provider,
      //   commonHooks.discard('password')
      // )
    ],
    get: [],
    create: [],
    update: [],
    patch: [],
    remove: []
  },

  error: {
    all: [],
    find: [],
    get: [],
    create: [],
    update: [],
    patch: [],
    remove: []
  }
}
